
#ifndef __LOG__
#define __LOG__
#include <func.h>

//int InitLog(const char * log_dir);

#define NETDESK_LOG_LOGIN(username)  \
{ \
    time_t now_time = time(NULL); \
    syslog(LOG_INFO,"user:%s, login time = %s ",username,ctime(&now_time)) ; \
} 
#define NETDESK_LOG_INFO(username,operation) \
{\
    time_t now_time = time(NULL);\
    syslog(LOG_INFO,"user:%s ,operation: %s, time = %s",username,operation,ctime(&now_time));\
}
#define NETDESK_LOG_DEBUG(username,msg)  \
{\
    time_t now_time = time(NULL);   \
    syslog(LOG_DEBUG,"user:%s ,filename:%s ,debug:%s ,line:%d ,function:%s ,time:%s ",  \
           username,__FILE__,msg,__LINE__,__FUNCTION__,ctime(&now_time));  \
}


int InitLog(const char * log_dir);
void DeInitLog();

#endif
